const path = require('path');
const ScriptSetup = require('unplugin-vue2-script-setup/webpack').default
const AutoImport = require('unplugin-auto-import/webpack')

module.exports = {
    lintOnSave: 'warning',
    parallel: false,  // disable thread-loader, which is not compactible with this plugin
    devServer: {
      client: {
        overlay: false,
      },
    },
    configureWebpack: {
      resolve: {
        alias: {
          '@': path.join(__dirname, './src'),
        },
        extensions: ['.js', '.ts', '.vue', '.json']
      },
      module: {
        rules: [
          { test: /\.ts?$/, loader: 'ts-loader' }
        ]
      },
      plugins: [
        ScriptSetup({ /* options */ }),
        AutoImport({
          imports: ['@vue/composition-api'],
          eslintrc: {
            enabled: true, // Default `false`
            filepath: './.eslintrc-auto-import.json',
            globalsPropValue: true // Default `true`
          },
        })
      ]
    }
  }
